13. Short Message Service (SMS) Commands > 13.5 AT+CMGL   List SMS messages from preferred store

13.5
AT+CMGL   List SMS messages from preferred store
The write command returns messages with status value <stat> from message storage <mem1> to the TE. If the status of the message is 'received unread', the status in the storage changes to 'received read'.
The execute command is the same as the write command with the given default for <stat>.
Syntax
Test Command  
Response(s)
+CMGL: (list of supported <stat>s)
Exec Command  
Response(s)
+CMGL: (see write command for default of <stat>)
Write Command  
Response(s)
Output if text mode (AT+CMGF=1) and command successful:
Output if PDU mode AT+CMGF=0 and command successful:
Reference(s) 
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 
GSM 07.05

Notes
•
The selected <mem1> can contain different types of SMs (e.g. SMS-DELIVERs, SMS-SUBMITs, SMS-STA­TUS-REPORTs and SMS-COMMANDs), the response may be a mix of the responses of different SM types. TE application can recognize the response format by examining the third response parameter.
•
The parameters <ra> and <tora> will only be displayed if parameter <ra> of the AT^SSCONF command is set to 1.
•
Users should be aware that when using this AT command quickly after SIM PIN authentication the SIM data may not yet be accessible, resulting in a short delay before the requested AT command response is returned. See Section 23.1, Restricted access to SIM data after SIM PIN authentication for further detail.
•
If the ME is Java controlled, take into account that the AT Command API can handle responses up to a length of 1024 bytes. To avoid any longer reponses it is recommended not to read the entire range of phonebook entries at a time.